class_name JumpAbility
extends GameplayAbility


func _on_owner_set() -> void:
	pass


func _can_apply() -> bool:
	return true


func _on_update(_delta: float) -> void:
	var player = owner.get_parent() as Player
	if not player:
		return
	
	if player.input_handler.is_action_pressed("jump"):
		player.try_apply_ability_to_self(ability_asset)


func _create_spec(target: AbilitySystemComponent) -> GameplayAbilitySpec:
	return JumpAbilitySpec.new(self, target)
